<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace addons\equip\user\controller;

use addons\member\model\RewardForLog as RewardForLogM;

/**
 * 奖励领取记录表
 * Class RewardForLog
 * @package addons\equip\user\controller
 */
class RewardForLog extends \web\user\controller\AddonUserBase {

    public function index() {
        return $this->fetch();
    }

    /**
     * 锁仓列表
     * @return array
     */
    public function loadList() {
        $keyword = $this->_get('keyword');
        $filter = ' 1=1';
        if ($keyword != null) {
//            $filter .= ' and a.user_id like \'%' . $keyword . '%\' or equip_name like \'%' . $keyword . '%\' or username like \'%' . $keyword . '%\' or phone like \'%' . $keyword . '%\'';
             $filter .= ' and b.phone like \'%' . $keyword . '%\' or b.username like \'%' . $keyword . '%\' ';
        }
        $m = new RewardForLogM;
        $total = $m->getBonusTotal($filter);
        $fields = 'a.*,b.username,b.phone';
        $rows = $m->getBonusList($this->getPageIndex(), $this->getPageSize(), $filter, $fields);
        return $this->toDataGrid($total, $rows);
    }


}
